/**
 * 输出完数
 */
public class Homework {

    public static void main(String[] args) {
        for (int a = 2; a <= 1000; a++) {
            int s = a;
            for (int i = 1; i < a; i++) {
                if (a % i == 0) {
                    s = s - i;
                }
            }
            if (s == 0) {
                System.out.println("1000内的完数有：" + a);
            }
        }
    }
}
